<template>
	<view class="c-container">
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.contract_no">
				<view class="col-title">合同编号</view>
				<view class="col-text">{{orderInfo.contract_no}}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">订单类型</view>
				<view class="col-text">{{orderInfo.news_type}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.company_id > 0">
				<view class="col-title">签约公司</view>
				<view class="col-text">{{orderInfo.company}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.hotel">
				<view class="col-title">举办酒店</view>
				<view class="col-text">{{orderInfo.hotel}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.hall && orderInfo.hall.length > 0">
				<view class="col-title">宴会厅</view>
				<view class="col-text"><van-tag type="success" v-for="item in orderInfo.hall" :key="item.id" >{{item.title}}</van-tag></view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col"  v-if="orderInfo.banquet_type && orderInfo.banquet_type.length > 0">
				<view class="col-title">宴会类型</view>
				<view class="col-text">{{dictionary.convertBanquetTypeToStr(orderInfo.banquet_type)}}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">订单渠道</view>
				<view class="col-text">{{ orderInfo.source_text }}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">举办时间</view>
				<view class="col-text">{{orderInfo.event_date}}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">销售</view>
				<view class="col-text">{{orderInfo.username}}</view>
			</view>
		</view>
		<view class="c-row" v-if="meetingInfo.customer_company">
			<view class="c-row-col">
				<view class="col-title">公司名称</view>
				<view class="col-text">{{meetingInfo.customer_company}}</view>
			</view>
		</view>
		<view class="c-row" v-if="meetingInfo.address">
			<view class="c-row-col">
				<view class="col-title">地址</view>
				<view class="col-text">{{meetingInfo.address}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">联系人</view>
				<view class="col-text">{{orderInfo.bridegroom}}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">联系电话</view>
				<view class="col-text">{{orderInfo.bridegroom_mobile}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">餐饮金额</view>
				<view class="col-text">{{meetingInfo.food_totals}}</view>
			</view>
			<view class="c-row-col">
				<view class="col-title">布置金额</view>
				<view class="col-text">{{meetingInfo.arrangement}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col">
				<view class="col-title">订单金额</view>
				<view class="col-text">{{orderInfo.totals}}</view>
			</view>
		</view>
		<view class="c-row">
			<view class="c-row-col" v-if="orderInfo.score">
				<view class="col-title">积分</view>
				<view class="col-text">{{orderInfo.score}}</view>
			</view>
			<!-- <view class="c-row-col">
				<view class="col-title">积点</view>
				<view class="col-text">{{orderInfo.point}}</view>
			</view> -->
		</view>
		<view class="c-row" v-if="orderInfo.images">
			<view class="c-row-col">
				<view class="col-title">合同照片</view>
				<view class="col-text">
					<image class="col-img" v-for="(img, imgIndex) in orderInfo.images" :key="imgIndex" :src="img"
						@click="previewImg({list:orderInfo.images,index: imgIndex})"></image>
				</view>
			</view>
		</view>
		<view class="c-row" v-if="orderInfo.addons && orderInfo.addons.length > 0">
			<view class="c-row-col">
				<view class="col-title p100">订单增项</view>
				<view class="col-text">
					<view class="c-row-box">
						<view class="panel-body">
							<view class="other-list">
								<view class="row" style="padding: 0 8px;">
									<view class="col">
										<view>类型</view>
									</view>
									<view class="col">
										<view>数量</view>
									</view>
									<view class="col">
										<view>价格</view>
									</view>
									<view class="col">
										<view>小计</view>
									</view>
								</view>
								<view class="row" v-for="(item,index) in orderInfo.addons" :key="index">
									<view class="col">
										<view class="col-item-text">
											<template v-if="item.ritual_id > 0">
												{{dictionary.getPickerTitle('ritualList', item.ritual_id)}}
											</template>
											<template>
												{{item.title}}
											</template>
										</view>
									</view>
									<view class="col">
										<view>{{item.amount}}</view>
									</view>
									<view class="col">
										<view>{{item.price}}</view>
									</view>
									<view class="col">
										<view>{{item.total}}</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import dictionary from '@/utils/dictionary.js';
	export default {
		name: 'cDetail',
		props: {
			meetingInfo: {
				type: Object,
				default () {
					return {}
				}
			},
			orderInfo: {
				type: Object,
				default () {
					return {}
				}
			}
		},
		data() {
			return {}
		},
		beforeMount() {
			this.dictionary = dictionary;
		},
		methods: {
			// 预览图片
			previewImg(data) {
				uni.previewImage({
					urls: data.list,
					current: data.index
				})
			}
		}
	}
</script>

<style lang="less">
	@import url('../common.less');
	.c-container .van-tag{
		margin-right: 5px !important;
	}
</style>
